package org.wadael.waverobotfrmwrk.simple;

import com.google.wave.api.Blip;
import com.google.wave.api.event.Event;
import com.google.wave.api.impl.EventMessageBundle;

@SuppressWarnings("serial")
public abstract class LimitedObedienceBlipModifierRobot extends BlipModifierRobot {
	/*
	 * Need to find a way to share this with the appender counterpart
	 * @param event
	 * @return
	 */
	public boolean shouldObey(Event event) {
		String eventStarter = event.getModifiedBy() ;
		if(getAuthorisedUsers().contains(eventStarter)) return true;
		return false;
	}

	public void whatToDoIfNotToObey(EventMessageBundle bundle, Blip blip, Event event){
		blip.reply().append("\n " +event.getModifiedBy() + " is not authorised." );
	}
	
	

}
